import org.apache.ibatis.session.SqlSession;
import org.junit.Test;
import property.mapper.AdminMapper;
import property.mapper.UserMapper;
import property.pojo.Admin;
import property.pojo.AdminExample;
import property.pojo.UserExample;
import property.utils.mapper.MyBatisUtil;

import javax.print.attribute.standard.JobKOctets;
import java.util.List;

public class testLike {
    @Test
    public void  test1(){
        String keyword="6";
        String email="456";
        SqlSession sqlSession = MyBatisUtil.getSqlSession();
        AdminMapper mapper = sqlSession.getMapper(AdminMapper.class);
        AdminExample adminExample=new AdminExample();
            AdminExample.Criteria adminExampleCriteria = adminExample.createCriteria();
//            if(user.getUName() != null)

            adminExampleCriteria.andANameLike("%" );
//            adminExampleCriteria.andABirthdateIsNotNull();
//            adminExampleCriteria.andAIdBetween(1, 1);
//            adminExample.or(adminExampleCriteria);
//        AdminExample.Criteria criteria1 = adminExampleCriteria.andANameLike("%" + keyword + "%");//可无限使用and拼接
//        AdminExample.Criteria criteria2 = adminExampleCriteria.andABirthdateIsNotNull();
//        AdminExample.Criteria criteria3 = adminExampleCriteria.andAIdBetween(1, 1);
//        adminExample.or(criteria1);
//        adminExample.or(criteria2);
//        adminExample.or(criteria3);
//        List<AdminExample.Criteria> oredCriteria = adminExample.getOredCriteria();
//        oredCriteria.add(criteria1);
//        oredCriteria.add(criteria2);
        List<Admin> adminList = mapper.selectByExample(adminExample);
        System.out.println(adminList);
    }
}
